#ifndef DEVICECHANNELTABLEWIDGET_H
#define DEVICECHANNELTABLEWIDGET_H

#include <QTableWidget>
#include <QList>
#include "devicechannel.h"
#include "devicesubchannel.h"

class DeviceChannelTableWidget : public QTableWidget
{
    Q_OBJECT

public:
    explicit DeviceChannelTableWidget(QWidget *parent = nullptr);

    // 添加 DeviceChannel
    void addDeviceChannel(DeviceChannel *channel);

    // 为指定 DeviceChannel 添加 DeviceSubChannel
    void addDeviceSubChannel(DeviceChannel *parentChannel, DeviceSubChannel *subChannel);

private slots:
    // 处理设置按钮点击事件
    void onSettingsButtonClicked();

    // 处理更多按钮点击事件
    void onMoreButtonClicked(DeviceChannel *parentChannel);

private:
    // 初始化表格
    void initTable();

    // 刷新表格数据
    void refreshTable();

    QList<DeviceChannel*> deviceChannels; // 存储所有 DeviceChannel
};

#endif // DEVICECHANNELTABLEWIDGET_H
